Skip to main content

DigiLocker Fetch All Documents API

The following document highlights the details of the DigiLocker Fetch All Documents API.

API Description

Objective

The DigiLocker Fetch All Documents API retrieves and returns all available documents from Digilocker.

InputOutput
A unique reference identifier and file parameterAll available documents from Digilocker including document types, URIs, and extracted data (name, address, date of birth, gender, photo, etc.)

API URL

https://ind-verify.hyperverge.co/api/digilocker/fetchAllDocuments

API Endpoint

fetchAllDocuments

Overview

The DigiLocker Fetch All Documents API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.

Method - POST

Authentication

You need a unique pair of application ID ( appId ) and application key ( appKey ) from HyperVerge to verify your identity for accessing the API.

Headers

HeaderMandatory / OptionalDescriptionInput Format
content-type MandatoryThis parameter defines the media type for the request payloadapplication/json
appId MandatoryThe application identifier shared by HyperVerge. You can find the details in the dashboard's credentials tabThis should be a unique value
appKey MandatoryThe application key shared by HyperVerge. You can find the details in the dashboard's credentials tabThis should be a unique value
transactionIdOptionalA unique identifier for tracking a user journeyThis should be both unique and easily associated with the user's journey in your application(s)

Inputs

The following table provides the details of the parameters required for the DigiLocker Fetch All Documents API's request body:

ParameterMandatory / OptionalTypeDescriptionInput FormatDefault Value
referenceIdMandatorystringThe reference ID generated in the initial requestNot ApplicableNot Applicable
fileMandatorystringWhen set to yes, it returns the URL of the document fileyes or noNot Applicable

Request

The following code snippet demonstrates a standard curl request for the DigiLocker Fetch All Documents API:

curl --location --request POST 'https://ind-verify.hyperverge.co/api/digilocker/fetchAllDocuments' \
--header 'Content-Type: application/json' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--data-raw '{
"referenceId": "<Enter_the_Reference_ID>",
"file": "<Enter_yes_or_no>"
}'

Success Responses

The following code snippets demonstrate success responses from the DigiLocker Fetch All Documents API:

{
"status": "success",
"statusCode": "200",
"result": [
{
"0": {
"docId": "ADHAR",
"uri": "in.gov.uidai-ADHAR-<Unique_Aadhaar_Identifier>",
"data": {
"name": "<Name_of_the_User>",
"address": "<Address_Of_The_User>",
"dob": "<Date_Of_Birth_in_DD-MM-YYYY_Format>",
"gender": "<Gender>",
"maskedAadhaarNumber": "<Masked_Aadhaar_Number>",
"photo": "<Base64_Image_Of_The_Users_Profile_Photo>",
"file": "<Base64_Encoded_Aadhaar_File>"
}
},
"1": {
"docId": "PANCR",
"uri": "in.gov.pan-PANCR-<Unique_PAN_Identifier>",
"data": {
"number": "<PAN_Number>",
"name": "<Name_of_the_User>",
"dob": "<Date_Of_Birth_in_DD-MM-YYYY_Format>",
"address": "<Address_Of_The_User>",
"photo": "<Base64_Image_Of_The_Users_Profile_Photo>",
"file": "<Base64_Encoded_PAN_File>"
}
}
},
{}
]
}

Success Response Details

The following table outlines the details of the success response from the DigiLocker Fetch All Documents API:

ParameterTypeDescription
statusstringThe status of the request
statusCodestringThe HTTP status code for the response
resultarrayAn array containing the document data for the user
result[].docIdstringThe document identifier, such as Aadhaar or PAN
result[].uristringThe URI for the document in the respective government database
result[].dataobjectThe data object containing user information specific to each document
result[].data.namestringThe name of the user
result[].data.addressstringThe complete address of the user
result[].data.dobstringThe date of birth of the user in DD-MM-YYYY format
result[].data.genderstringThe gender of the user
result[].data.maskedAadhaarNumberstringThe masked Aadhaar number of the user
result[].data.photostringThe base64-encoded profile photo of the user
result[].data.filestringThe base64-encoded file of the document
result[].data.numberstringThe PAN number of the user

Error Responses

The following are some error responses from the DigiLocker Fetch All Documents API:

{
"status": "failure",
"statusCode": "400",
"error": {
"code": "ER_INVALID_REFID",
"message": "Please try verifying the refId"
}
}
{
"status": "failure",
"statusCode": "504",
"error": {
"code": "ER_DIGILOCKER_REPO_SERVICE_INACTIVE",
"message": "Error Connecting to digilocker. Please try again after sometime."
}
}

Error Response Details

A failure or error response contains a failure status with a relevant status code and error message.
The following table lists all error responses:

Status CodeError MessageError DescriptionError Resolution
400Please try verifying the refIdThe provided referenceId is invalidVerify and provide a valid referenceId
400referenceId is not allowed to be emptyThe referenceId parameter is provided but is emptyProvide a non-empty referenceId in the request
400referenceId is requiredThe mandatory referenceId parameter is missing from the requestProvide valid referenceId in the request
400Invalid Aadhaar XMLThe Aadhaar XML file provided is invalidPlease upload a valid Aadhaar XML file
401Missing/Invalid credentialsThe request is either missing the mandatory appId and appKey combination or has invalid valuesProvide valid appId and appKey credentials in the request
504Error Connecting to digilocker. Please try again after sometime.DigiLocker repository service is unresponsive, unpublished, inactive, has a configuration error, response error, or exceptionPlease try again after sometime or contact the HyperVerge team
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: